<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>Chain Responsive Bootstrap3 Admin</title>

        <link href="css/style.default.css" rel="stylesheet">
        <link href="css/morris.css" rel="stylesheet">
        <link href="css/select2.css" rel="stylesheet" />
        <link href="js/jeDate/jedate.css" rel="stylesheet" />

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="js/html5shiv.js"></script>
        <script src="js/respond.min.js"></script>
        <![endif]-->

    </head>

    <body>



        <header>
            <div class="headerwrapper">
            <!--    <div class="header-left">
                    <a href="index.html" class="logo">

                    </a>
                </div> header-left -->
                <img src="images/logo.png" alt="" />
                

            </div><!-- headerwrapper -->
        </header>

        <section>
            <div class="mainwrapper">
                <div class="leftpanel">
                    <div class="media profile-left">
                        <a class="pull-left profile-thumb" href="profile.html">
                            <img class="img-circle" src="images/photos/profile.png" alt="">
                        </a>
                        <div class="media-body">
                            <h4 class="media-heading">Elen Adarna</h4>
                            <small class="text-muted">Beach Lover</small>
                        </div>
                    </div><!-- media -->

                    <h5 class="leftpanel-title">导航</h5>
                    <ul class="nav nav-pills nav-stacked">
                        <li ><a href="index.html"><i class="fa fa-home"></i> <span>主页</span></a></li>

                         <li class="parent"><a href=""><i class="fa fa-bars"></i> <span>信息查询</span></a>
                            <ul class="children">
                                <li><a href="search.html">日志查询</a></li>
                            </ul>
                        </li>
                         <li class="parent"><a href=""><i class="fa fa-edit"></i> <span>统计</span></a>
                            <ul class="children">
                                <li><a href="tj_yhbl.html">用户比例统计</a></li>
                            </ul>
                            <ul class="children">
                                <li><a href="tj_yhpm.html">用户排名统计</a></li>
                            </ul>
                            <ul class="children">
                                <li><a href="tj_bbl.html">表比例统计</a></li>
                            </ul>
                            <ul class="children">
                                <li><a href="tj_bpm.html">表排名统计</a></li>
                            </ul>
                        </li>
                        <li class="parent"><a href=""><i class="fa fa-exclamation-circle"></i> <span>警告通知</span></a>
                        	<ul class="children">
                                <li><a href="czplsz.html">操作频率设置</a></li>
                                <li><a href="czjlssz.html">操作记录数设置</a></li>
                                <li><a href="tzck.html">通知查看</a></li>
                            </ul>
                        </li>
                        <li class="active" class="parent"><a href=""><i class="fa fa-cogs"></i> <span>系统管理</span></a>
                            <ul class="children">
                                <li><a href="user.html">用户管理</a></li>
                                <li class="active"><a href="jdck.html">节点查看</a></li>
                                <li><a href="tbEtl.html">数据抽取配置</a></li>
                            </ul>
                        </li>

                    </ul>

                </div><!-- leftpanel -->

                <div class="mainpanel">
                    <div class="pageheader">
                        <div class="media">
                            <!-- <div class="pageicon pull-left">
                                <i class="fa fa-home"></i>
                            </div> -->
                            <div class="media-body">
                               <!--  <ul class="breadcrumb">
                                    <li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
                                    <li>Dashboard</li>
                                </ul> -->
                                <h4 style="margin-top:10px;">节点信息查看</h4>
                            </div>
                        </div><!-- media -->
                    </div><!-- pageheader -->

                   <div class="contentpanel">
                        <div class="row">
                            <div class="col-sm-3 col-md-3 col-lg-2">
                                <a href="javascript:void(0);" class="btn btn-success btn-block btn-create-msg">节点列表</a>
                                <br />
                                <ul class="nav nav-pills nav-stacked nav-msg" id="jdlbUl">

                                    <li ><a id="219"  style="background-color:#eee;" href="javascript:showFirst('192.168.0.219');"><i class="glyphicon glyphicon-star"></i> 219</a></li>
                                    <li><a id="220"  href="javascript:showFirst('192.168.0.220');"><i class="glyphicon glyphicon-star"></i> 220</a></li>
                                    <li><a id="221"  href="javascript:showFirst('192.168.0.221');"><i class="glyphicon glyphicon-star"></i> 221</a></li>
                                    <li><a id="223"  href="javascript:showFirst('192.168.0.223');"><i class="glyphicon glyphicon-star"></i> 223</a></li>

                                </ul>


                            </div>

                            <div class="col-sm-9 col-md-9 col-lg-10">

                                <div style="margin-bottom: 25px;margin-top: 5px;">
                                <form class="form-inline">
                                <span style="font-size:14px;font-weight:bold;margin-left:5px;">按时间检索：</span>
                                   <div class="form-group">
                                        <label class="sr-only" for="exampleInputEmail2">Email address</label>
                                        <input id="inpstart" style="width:268px;"  type="text" class="form-control" id="exampleInputEmail2" placeholder="起始时间">
                                    </div><!-- form-group -->

                                    <div class="form-group">
                                        <label class="sr-only" for="exampleInputPassword2">Password</label>
                                        <input id="inpend" style="width:268px;"  type="text" class="form-control" id="exampleInputPassword2" placeholder="结束时间">
                                    </div><!-- form-group -->

                                     <button onclick="flushDate();" type="button" style="border-radius:3px;width:78px;height:37px; color: #fff;    border-width: 0px;" class="btn btn-primary">查看</button>
                                  <button style="margin-left:5px;border-radius:3px;width:68px;height:37px; border-width: 0px;" type="reset" class="btn btn-default">重置</button>
                                    </form>

                                </div><!-- msg-header -->

                               <div id="main" style="height:400px;margin-top:10px;"></div>
                               <div id="main1" style="height:400px;margin-top:40px;border-top: 1px solid #ddd;"></div>
                               <div id="main2" style="height:400px;margin-top:40px;border-top: 1px solid #ddd;"></div>
                            </div>
                        </div>
                    </div><!-- contentpanel -->

                </div><!-- mainpanel -->
            </div><!-- mainwrapper -->
        </section>


        <script src="js/jquery-1.11.1.min.js"></script>
        <script src="js/jquery-migrate-1.2.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/modernizr.min.js"></script>
        <script src="js/pace.min.js"></script>
        <script src="js/retina.min.js"></script>
        <script src="js/jquery.cookies.js"></script>

        <script src="js/flot/jquery.flot.min.js"></script>
        <script src="js/flot/jquery.flot.resize.min.js"></script>
        <script src="js/flot/jquery.flot.spline.min.js"></script>
        <script src="js/jquery.sparkline.min.js"></script>
        <script src="js/morris.min.js"></script>
        <script src="js/raphael-2.1.0.min.js"></script>
        <script src="js/bootstrap-wizard.min.js"></script>
        <script src="js/select2.min.js"></script>

        <script src="js/custom.js"></script>
        <script src="js/dashboard.js"></script>
        <script src="js/jeDate/jquery.jedate.min.js"></script>
        <script src="js/echarts.min.js"></script>
    <input type="hidden" id="jdip"  value="192.168.0.219"/>
    </body>
     <script type="text/javascript">
     getData('192.168.0.219');
var start = {
    format: 'YYYY-MM-DD hh:mm:ss',
    minDate: '2014-06-16 23:59:59', //设定最小日期为当前日期
    //festival:true,
    maxDate: $.nowDate({DD:0}), //最大日期
    choosefun: function(elem,datas){
        end.minDate = datas; //开始日选好后，重置结束日的最小日期
        endDates();
    },
    okfun:function (elem,datas) {
       // alert(datas)
    },
    clearfun:function(elem, val) {
      start.maxDate='2099-06-16 23:59:59'
    }
};
var end = {
    format: 'YYYY-MM-DD hh:mm:ss',
    minDate: $.nowDate({DD:0}), //设定最小日期为当前日期
    //festival:true,
    maxDate: '2099-06-16 23:59:59', //最大日期
    choosefun: function(elem,datas){
        start.maxDate = datas; //将结束日的初始值设定为开始日的最大日期
    },
    clearfun:function(elem, val) {
      end.minDate='2014-06-16 23:59:59'
    }
};
function endDates() {
    end.trigger = false;
    $("#inpend").jeDate(end);
}
$("#inpstart").jeDate(start);
$("#inpend").jeDate(end);

function showFirst(ip){
$('#jdip').val(ip);
$('#jdlbUl a').removeAttr("style");
    $('#'+ip.split('.')[3]).css('background-color','#eee');
getData(ip);
}

/* $('#jdlbUl a').bind("click", function() {
   $(this).css('background-color','#eee');
}); */
//加载性能图
function getData(ip){
		$.ajax({
		type : "post",
		url : "./XtAction/getFJdzy.do",
		data : {
		jdip:ip
		},
		dataType : "json",
		success : function(dat) {
		var myChart = echarts.init(document.getElementById('main'));
option = {
    title: {
        text: 'cpu使用率图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['使用率']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data1
    },
    yAxis: {
        type: 'value',
        name: '单位：百分比(%)',
        nameLocation:'end',
        max:100
    },
    series: [
        {
            name:'使用率',
            type:'line',
            stack: '总量',
            data:dat.data2
        }
    ]
};

  myChart.setOption(option);


  	var myChart1 = echarts.init(document.getElementById('main1'));
  	option1 = {
    title: {
        text: '内存使用图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['占用']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data3
    },
    yAxis: {
        type: 'value',
        name: '单位：Mb',
        nameLocation:'end',
        max:4096
    },
    series: [
        {
            name:'占用',
            type:'line',
            stack: '总量',
            data:dat.data4
        }
    ]
};

  	myChart1.setOption(option1);
  	var myChart2 = echarts.init(document.getElementById('main2'));
  	option2 = {
    title: {
        text: '硬盘使用图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['使用量']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data5
    },
    yAxis: {
        type: 'value',
        name: '单位：Gb',
        nameLocation:'end',
        max:40
    },
    series: [
        {
            name:'使用量',
            type:'line',
            stack: '总量',
            data:dat.data6
        }
    ]
};
  	myChart2.setOption(option2);
		}
		});
		$("#page-stats").hide();
        $("#xnt").show();
		}


function flushDate(){
var time1=$('#inpstart').val();
var time2=$('#inpend').val();
		$.ajax({
		type : "post",
		url : "./XtAction/getJdzy.do",
		data : {
		startTime:time1,
		endTime:time2,
		ip:$('#jdip').val()
		},
		dataType : "json",
		success : function(dat) {
				var myChart = echarts.init(document.getElementById('main'));
option = {
    title: {
        text: 'cpu使用率图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['使用率']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data1
    },
    yAxis: {
        type: 'value',
        name: '单位：百分比(%)',
        nameLocation:'end',
        max:100
    },
    series: [
        {
            name:'使用率',
            type:'line',
            stack: '总量',
            data:dat.data2
        }
    ]
};

  myChart.setOption(option);


  	var myChart1 = echarts.init(document.getElementById('main1'));
  	option1 = {
    title: {
        text: '内存使用图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['占用']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data3
    },
    yAxis: {
        type: 'value',
        name: '单位：Mb',
        nameLocation:'end',
        max:4096
    },
    series: [
        {
            name:'占用',
            type:'line',
            stack: '总量',
            data:dat.data4
        }
    ]
};

  	myChart1.setOption(option1);
  	var myChart2 = echarts.init(document.getElementById('main2'));
  	option2 = {
    title: {
        text: '硬盘使用图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['使用量']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: dat.data5
    },
    yAxis: {
        type: 'value',
        name: '单位：Gb',
        nameLocation:'end',
        max:40
    },
    series: [
        {
            name:'使用量',
            type:'line',
            stack: '总量',
            data:dat.data6
        }
    ]
};
  	myChart2.setOption(option2);

		}
		});
		}
</script>
 <script src="js/my.js"></script>
        <script type="text/javascript">
        getUsername();
        </script>
</html>
